package com.itheima.clientAndService01;

import java.util.ArrayList;

public class ArgsClass04 {
    public static void main(String[] args) {
        ArrayList<String> list = new ArrayList<>();
        list.add("张飞");
        list.add("夏侯渊");
        list.add("夏侯");
        list.add("李世民");
        list.add("夏侯惇");
        list.add("康熙");
        list.add("夏侯霸");
        list.stream().filter(s -> s.startsWith("夏"))
                .filter(s -> s.length() == 3)
                .forEach(s -> System.out.println(s));
        /*list.stream().filter(new Predicate<String>() {
            @Override
            public boolean test(String s) {
                return s.length() == 3;
            }
        }).forEach(s -> System.out.println(s));*/
    }
}
